package cn.tedu.service;/**
 * @Author 金帮嘉诚 @Date 2021-07-19 星期一 18:33
 */
/*本类用于测试*/

import cn.tedu.dao.DeptDao;
import cn.tedu.mapper.DeptMapper;
import cn.tedu.pojo.Dept;
import cn.tedu.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 知识点
 */
@Service
public class DeptServiceImpl implements DeptService {
    private DeptMapper deptMapper = getDeptMapper();

    @Override
    public DeptMapper getDeptMapper() {
        SqlSession sqlSession = MybatisUtil.getSession();
        DeptMapper deptMapper = sqlSession.getMapper(DeptMapper.class);
        return deptMapper;
    }

    @Override
    public List<Dept> getBy(Dept dept) {
        return deptMapper.getBy(dept);
    }

    @Override
    public List<Dept> getAll() {
        return deptMapper.getAll();
    }


}
